/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.bytedance.scenedemo.animatiom.sipnner;

import ohos.agp.components.Component;

/**
 * PopupAnimator.
 *
 * @since 2021-06-17
 */
public abstract class PopupAnimator {
    /**
     * targetView
     */
    private Component targetView;

    /**
     * popupAnimation
     */
    private PopupAnimation popupAnimation; // 内置的动画

    /**
     * PopupAnimator
     */
    public PopupAnimator() {
    }

    /**
     * PopupAnimator
     *
     * @param target Component
     */
    public PopupAnimator(Component target) {
        this(target, null);
    }

    /**
     * PopupAnimator
     *
     * @param target Component
     * @param popupAnimation PopupAnimation
     */
    public PopupAnimator(Component target, PopupAnimation popupAnimation) {
        this.targetView = target;
        this.popupAnimation = popupAnimation;
    }

    /**
     * initAnimator
     */
    public abstract void initAnimator();
    /**
     * animateShow
     */

    public abstract void animateShow();
    /**
     * animateDismiss
     */

    public abstract void animateDismiss();

    /**
     * getDuration
     *
     * @return getDuration
     */
    public int getDuration() {
        return Popup.getAnimationDuration();
    }

    public Component getTargetView() {
        return targetView;
    }

    public void setTargetView(Component targetView) {
        this.targetView = targetView;
    }

    public PopupAnimation getPopupAnimation() {
        return popupAnimation;
    }

    public void setPopupAnimation(PopupAnimation popupAnimation) {
        this.popupAnimation = popupAnimation;
    }
}
